package com.github.vortexdev.yachtclub.jsonmodels;

/**
 * JqGridTableRows is model of JSON response for jqGrid (JavaScript library)
 * @author Sergey Parakhin (sergey.parahin@gmail.com)
 */
public class JqGridTableRows<T> {
    private int records;
    private int page;
    private int total;
    private T[] rows;

    /*
     * Constructor
     * @param data     Array of models (rows)
     * @param page     Current page number
     * @param records  Number of rows
     * @param total    Number of pages
     */
    public JqGridTableRows(T[] data, int page, int records, int total) {
        this.rows = data;
        this.page = page;
        this.records = records;
        this.total = total;
    }

    public int getRecords() {
        return records;
    }

    public int getPage() {
        return page;
    }

    public int getTotal() {
        return total;
    }

    public T[] getRows() {
        return rows;
    }
}
